package com.gsn.dataCommon;

/*
 * Du lieu cua user dang nhap vao portal
 */
public class UserData {
	public static String name = "";
	public static String passWord;
	public static String sessionKey = "";
	public static boolean save = false;
	public static boolean music = false;
	public static boolean sound = false;
	public static boolean vibrate = false;
	public static String avatar = "";
	public static UserData instance;
	public static final String NAME = "name";
	public static final String PASSWORD = "password";
	public static final String SAVE_PASS = "savePass";
	public static final String SESSION_KEY = "sessionKey";

	public static final String SOUND = "sound";
	public static final String MUSIC = "music";
	public static final String VIBRATE = "vibrate";

	public static long gold;
	public static int numSupport = 2;
	public static int xu;

	public static int giftIndex = 0;
	public static int myId;

	public UserData() {
		instance = this;
	}

	public static UserData getInstance() {
		if (instance == null)
			return new UserData();
		else
			return instance;
	}

	/*
	 * public void load(SharedPreferences shareData) { name =
	 * shareData.getString(NAME, ""); passWord = shareData.getString(PASSWORD,
	 * ""); save = shareData.getBoolean(SAVE_PASS, false); sessionKey =
	 * shareData.getString(SESSION_KEY, ""); sound = shareData.getBoolean(SOUND,
	 * true); music = shareData.getBoolean(MUSIC, true); vibrate =
	 * shareData.getBoolean(VIBRATE, true); }
	 * 
	 * public void save(SharedPreferences shareData) {
	 * 
	 * SharedPreferences.Editor editor = shareData.edit();
	 * editor.putString(NAME, name); editor.putString(PASSWORD, passWord);
	 * editor.putBoolean(SAVE_PASS, save); editor.putString(SESSION_KEY,
	 * sessionKey); editor.commit(); }
	 * 
	 * public void remove(SharedPreferences shareData) {
	 * SharedPreferences.Editor editor = shareData.edit();
	 * editor.remove(SAVE_PASS); editor.remove(NAME); editor.remove(PASSWORD);
	 * editor.remove(SESSION_KEY); editor.commit(); }
	 * 
	 * public void saveSetting(SharedPreferences shareData) {
	 * SharedPreferences.Editor editor = shareData.edit();
	 * editor.putBoolean(SOUND, sound); editor.putBoolean(MUSIC, music);
	 * editor.putBoolean(VIBRATE, vibrate);
	 * 
	 * editor.commit(); }
	 */
}
